// https://leetcode-cn.com/problems/valid-anagram/
class Solution {
public:
    bool isAnagram(string s, string t) {
        if (s.size() - t.size()) return false;
        int cnt[128] = {0};
        for (int i = 0; s[i]; i++) cnt[s[i]] += 1;
        for (int i = 0; t[i]; i++) {
            cnt[t[i]] -= 1;
            if (cnt[t[i]] == -1) return false;
        }
        return true;
    }
};